<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of BOperationFlowGroup
 *
 * @author ID59C
 */
class BOperationFlowGroup {
    const group_configurable_operationFlow = "configurable_operationFlow";

    //put your code here
    public $name = null;
    public $description = null;
    public $data = null;

    protected static function init() {
        $count = BRepositoryFactory::createRepository()->getCount(new BOperationFlowGroup());
        // if count = 1, mean root created
        if ($count <= 1) {
            $group = new BOperationFlowGroup();
            $group->name = self::group_configurable_operationFlow;
            $group->save();    
            $root = self::getRoot();
            $root->addChild($group);
        }
    }

    public static function find($item = NULL) {
        self::init();
        return parent::find($item);
    }
}

?>
